package eleme.openapi.sdk.api.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import eleme.openapi.sdk.api.BasicNopService;
import eleme.openapi.sdk.api.annotation.Service;
import eleme.openapi.sdk.api.entity.activity.ActivityApplyInfo;
import eleme.openapi.sdk.api.entity.activity.ChainSkuCouponDetail;
import eleme.openapi.sdk.api.entity.activity.CommonTargetCouponDetail;
import eleme.openapi.sdk.api.entity.activity.CommonTargetSkuCouponDetail;
import eleme.openapi.sdk.api.entity.activity.CouponTemplate;
import eleme.openapi.sdk.api.entity.activity.CouponTransactionCriteria;
import eleme.openapi.sdk.api.entity.activity.CreateInfo;
import eleme.openapi.sdk.api.entity.activity.OActivityDetail;
import eleme.openapi.sdk.api.entity.activity.OActivityFoodApplyResult;
import eleme.openapi.sdk.api.entity.activity.OActivityService;
import eleme.openapi.sdk.api.entity.activity.OActivityServiceDetails;
import eleme.openapi.sdk.api.entity.activity.OCouponActivity;
import eleme.openapi.sdk.api.entity.activity.ReceivedCouponDetail;
import eleme.openapi.sdk.api.entity.activity.ServiceResult;
import eleme.openapi.sdk.api.entity.activity.ShippingFeeActivityCreateInfo;
import eleme.openapi.sdk.api.entity.activity.SkuActivityFoodDetail;
import eleme.openapi.sdk.api.entity.activity.SkuActivityShopApplyInfoDTO;
import eleme.openapi.sdk.api.entity.activity.SkuCouponDetail;
import eleme.openapi.sdk.api.entity.activity.SkuPriceActivityDTO;
import eleme.openapi.sdk.api.entity.activity.TargetCouponDetail;
import eleme.openapi.sdk.api.entity.activity.TargetCouponInfo;
import eleme.openapi.sdk.api.entity.activity.TargetCouponQueryRequest;
import eleme.openapi.sdk.api.entity.activity.TargetCouponResult;
import eleme.openapi.sdk.api.enumeration.activity.CouponActivityType;
import eleme.openapi.sdk.api.enumeration.activity.CouponStatus;
import eleme.openapi.sdk.api.enumeration.activity.HostedType;
import eleme.openapi.sdk.api.enumeration.activity.OActivityStatus;
import eleme.openapi.sdk.api.enumeration.activity.PresentResult;
import eleme.openapi.sdk.api.enumeration.activity.TargetListType;
import eleme.openapi.sdk.api.exception.ServiceException;
import eleme.openapi.sdk.config.Config;
import eleme.openapi.sdk.oauth.response.Token;

/**
 * 活动服务
 */
@Service("eleme.activity")
public class ActivityService extends BasicNopService {

    public ActivityService(Config config, Token token) {
        super(config, token, ActivityService.class);
    }

    /**
     * 查询店铺邀约活动信息(即将下线)
     *
     * @param shopId 店铺Id
     * @return 店铺的邀约活动信息列表
     * @throws ServiceException 服务异常
     */
    public List<OActivityDetail> getInvitedActivityInfos(Long shopId) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("shopId", shopId);
        return call("eleme.activity.flash.getInvitedActivityInfos", params);
    }

    /**
     * 报名限量抢购活动(即将下线)
     *
     * @param activityId 活动Id
     * @param activityApplyInfo 活动报名信息
     * @return 报名结果（true表示操作成功）
     * @throws ServiceException 服务异常
     */
    public Boolean applyFlashActivity(Long activityId, ActivityApplyInfo activityApplyInfo) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("activityId", activityId);
        params.put("activityApplyInfo", activityApplyInfo);
        return call("eleme.activity.flash.applyFlashActivity", params);
    }

    /**
     * 通过店铺Id和活动Id分页查询报名详情(即将下线)
     *
     * @param activityId 活动Id
     * @param shopId 店铺Id
     * @param pageNo 页码
     * @param pageSize 每页数量
     * @return 该活动中所报名菜品的信息
     * @throws ServiceException 服务异常
     */
    public List<OActivityFoodApplyResult> getActivityApplyInfos(Long activityId, Long shopId, Long pageNo, Long pageSize)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("activityId", activityId);
        params.put("shopId", shopId);
        params.put("pageNo", pageNo);
        params.put("pageSize", pageSize);
        return call("eleme.activity.flash.getActivityApplyInfos", params);
    }

    /**
     * 修改活动菜品库存(即将下线)
     *
     * @param activityId 活动Id
     * @param shopId 店铺Id
     * @param itemId 菜品Id
     * @param stock 库存
     * @return 报名结果（true表示操作成功）
     * @throws ServiceException 服务异常
     */
    public Boolean updateActivityItemStock(Long activityId, Long shopId, Long itemId, Long stock) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("activityId", activityId);
        params.put("shopId", shopId);
        params.put("itemId", itemId);
        params.put("stock", stock);
        return call("eleme.activity.flash.updateActivityItemStock", params);
    }

    /**
     * 取消活动菜品(即将下线)
     *
     * @param activityId 活动Id
     * @param shopId 店铺Id
     * @param itemId 菜品Id
     * @return 报名结果（true表示操作成功）
     * @throws ServiceException 服务异常
     */
    public Boolean offlineFlashActivityItem(Long activityId, Long shopId, Long itemId) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("activityId", activityId);
        params.put("shopId", shopId);
        params.put("itemId", itemId);
        return call("eleme.activity.flash.offlineFlashActivityItem", params);
    }

    /**
     * 作废店铺与活动的关联关系(即将下线)
     *
     * @param activityId 活动Id
     * @param shopId 店铺Id
     * @return 报名结果（true表示操作成功）
     * @throws ServiceException 服务异常
     */
    public Boolean invalidShopActivity(Long activityId, Long shopId) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("activityId", activityId);
        params.put("shopId", shopId);
        return call("eleme.activity.flash.invalidShopActivity", params);
    }

    /**
     * 创建减配送费活动
     *
     * @param createInfo 创建减配送费活动的结构体
     * @param shopId 店铺Id
     * @return 创建好的减配送费活动Id
     * @throws ServiceException 服务异常
     */
    public Long createShippingFeeActivity(ShippingFeeActivityCreateInfo createInfo, Long shopId) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("createInfo", createInfo);
        params.put("shopId", shopId);
        return call("eleme.activity.shippingFee.createShippingFeeActivity", params);
    }

    /**
     * 作废减配送费活动
     *
     * @param activityId 活动Id
     * @param shopId 店铺Id
     * @param comment 作废原因
     * @return 操作结果（true表示操作成功）
     * @throws ServiceException 服务异常
     */
    public Boolean invalidShippingFeeActivity(Long activityId, Long shopId, String comment) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("activityId", activityId);
        params.put("shopId", shopId);
        params.put("comment", comment);
        return call("eleme.activity.shippingFee.invalidShippingFeeActivity", params);
    }

    /**
     * 通过店铺Id查询该店铺被邀约的美食活动
     *
     * @param shopId 店铺Id
     * @return 店铺的邀约活动信息列表
     * @throws ServiceException 服务异常
     */
    public List<OActivityDetail> queryInvitedFoodActivities(Long shopId) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("shopId", shopId);
        return call("eleme.activity.food.queryInvitedFoodActivities", params);
    }

    /**
     * 报名美食活动
     *
     * @param activityId 活动Id
     * @param activityApplyInfo 活动报名信息
     * @return 报名结果（true表示操作成功）
     * @throws ServiceException 服务异常
     */
    public Boolean applyFoodActivity(Long activityId, ActivityApplyInfo activityApplyInfo) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("activityId", activityId);
        params.put("activityApplyInfo", activityApplyInfo);
        return call("eleme.activity.food.applyFoodActivity", params);
    }

    /**
     * 通过店铺Id和活动Id分页查询店铺已报名的美食活动
     *
     * @param activityId 活动Id
     * @param shopId 店铺Id
     * @param pageNo 页码
     * @param pageSize 每页数量
     * @return 该活动中所报名菜品的信息
     * @throws ServiceException 服务异常
     */
    public List<OActivityFoodApplyResult> queryFoodActivities(Long activityId, Long shopId, Long pageNo, Long pageSize)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("activityId", activityId);
        params.put("shopId", shopId);
        params.put("pageNo", pageNo);
        params.put("pageSize", pageSize);
        return call("eleme.activity.food.queryFoodActivities", params);
    }

    /**
     * 修改美食活动的菜品库存
     *
     * @param activityId 活动Id
     * @param shopId 店铺Id
     * @param itemId 菜品Id
     * @param stock 库存
     * @return 报名结果（true表示操作成功）
     * @throws ServiceException 服务异常
     */
    public Boolean updateFoodActivityItemStock(Long activityId, Long shopId, Long itemId, Long stock)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("activityId", activityId);
        params.put("shopId", shopId);
        params.put("itemId", itemId);
        params.put("stock", stock);
        return call("eleme.activity.food.updateFoodActivityItemStock", params);
    }

    /**
     * 取消参与了美食活动的菜品
     *
     * @param activityId 活动Id
     * @param shopId 店铺Id
     * @param itemId 菜品Id
     * @return 报名结果（true表示操作成功）
     * 该接口目前只支持限量抢购活动
     * @throws ServiceException 服务异常
     */
    public Boolean offlineFoodActivityItem(Long activityId, Long shopId, Long itemId) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("activityId", activityId);
        params.put("shopId", shopId);
        params.put("itemId", itemId);
        return call("eleme.activity.food.offlineFoodActivityItem", params);
    }

    /**
     * 作废店铺与美食活动的关联关系
     *
     * @param activityId 活动Id
     * @param shopId 店铺Id
     * @return 报名结果（true表示操作成功）
     * 该接口目前只支持限量抢购活动
     * @throws ServiceException 服务异常
     */
    public Boolean unbindFoodActivity(Long activityId, Long shopId) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("activityId", activityId);
        params.put("shopId", shopId);
        return call("eleme.activity.food.unbindFoodActivity", params);
    }

    /**
     * 创建红包活动(即将下线)
     *
     * @param createInfo 创建红包活动的结构体
     * @return 创建好的红包活动Id
     * @throws ServiceException 服务异常
     */
    public Long createCouponActivity(CreateInfo createInfo) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("createInfo", createInfo);
        return call("eleme.activity.coupon.createCouponActivity", params);
    }

    /**
     * 向指定用户发放红包(即将下线)
     *
     * @param shopId 店铺Id
     * @param couponActivityId 红包活动Id
     * @param mobiles 需要发放红包的用户手机号列表
     * @return 红包发放结果：key(手机号)，value(成功或失败信息)
     * @throws ServiceException 服务异常
     */
    public Map<String, String> giveOutCoupons(Long shopId, Long couponActivityId, List<String> mobiles)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("shopId", shopId);
        params.put("couponActivityId", couponActivityId);
        params.put("mobiles", mobiles);
        return call("eleme.activity.coupon.giveOutCoupons", params);
    }

    /**
     * 定向赠红包
     *
     * @param shopId 店铺Id
     * @param mobile 需要发放红包的用户手机号
     * @param couponTemplate 定向赠红包的模板信息
     * @return 发放结果：成功或失败信息
     * @throws ServiceException 服务异常
     */
    public PresentResult presentCoupon(Long shopId, String mobile, CouponTemplate couponTemplate) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("shopId", shopId);
        params.put("mobile", mobile);
        params.put("couponTemplate", couponTemplate);
        return call("eleme.activity.coupon.presentCoupon", params);
    }

    /**
     * 分页查询店铺红包活动信息(即将下线)
     *
     * @param shopId 店铺Id
     * @param couponActivityType 红包活动类型
     * @param activityStatus 活动状态
     * @param pageNo 页码（第几页）
     * @param pageSize 每页数量
     * @return 红包活动信息列表
     * @throws ServiceException 服务异常
     */
    public List<OCouponActivity> queryCouponActivities(Long shopId, CouponActivityType couponActivityType, OActivityStatus activityStatus, Integer pageNo, Integer pageSize)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("shopId", shopId);
        params.put("couponActivityType", couponActivityType);
        params.put("activityStatus", activityStatus);
        params.put("pageNo", pageNo);
        params.put("pageSize", pageSize);
        return call("eleme.activity.coupon.queryCouponActivities", params);
    }

    /**
     * 分页查询店铺红包领取详情(即将下线)
     *
     * @param shopId 店铺Id
     * @param couponActivityId 红包活动Id
     * @param couponStatus 红包状态
     * @param pageNo 页码（第几页）
     * @param pageSize 每页数量
     * @return 红包领取详情
     * @throws ServiceException 服务异常
     */
    public ReceivedCouponDetail queryReceivedCouponDetails(Long shopId, Long couponActivityId, CouponStatus couponStatus, Integer pageNo, Integer pageSize)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("shopId", shopId);
        params.put("couponActivityId", couponActivityId);
        params.put("couponStatus", couponStatus);
        params.put("pageNo", pageNo);
        params.put("pageSize", pageSize);
        return call("eleme.activity.coupon.queryReceivedCouponDetails", params);
    }

    /**
     * 托管单店红包服务
     *
     * @param shopIds 餐厅id列表,长度不能超过20
     * @param hostedType 红包服务业务类型,暂只支持超级会员,"SUPER_VIP"
     * @param discounts 扣减额,请设置在[4,15]元,小数点后最多1位
     * @return 红包服务执行结果列表 example:[{"shopId":964715,"result":true,"reason":null},{"shopId":324966853,"result":false,"reason":"通用红包活动单店暂无权限操作"}]
     * @throws ServiceException 服务异常
     */
    public List<ServiceResult> hostShops(List<Long> shopIds, HostedType hostedType, Double discounts)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("shopIds", shopIds);
        params.put("hostedType", hostedType);
        params.put("discounts", discounts);
        return call("eleme.activity.coupon.hostShops", params);
    }

    /**
     * 查询红包服务托管情况
     *
     * @param shopIds 餐厅id列表,长度不能超过20
     * @param hostedType 红包服务业务类型,暂只支持超级会员,"SUPER_VIP"
     * @return 红包服务部分信息映射表 key:shopId ,value:OActivityService
     * example:{"964715":{"result":true,"discounts":4.0,"dailyStock":100000,"openStatus":true,"reason":null},"720315": {"result":false,"discounts":null,"dailyStock":null,"openStatus":null,"reason": "通用红包活动单店暂无权限操作"}}
     * @throws ServiceException 服务异常
     */
    public Map<Long, OActivityService> queryHostInfo(List<Long> shopIds, HostedType hostedType) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("shopIds", shopIds);
        params.put("hostedType", hostedType);
        return call("eleme.activity.coupon.queryHostInfo", params);
    }

    /**
     * 取消托管单店红包服务
     *
     * @param shopIds 餐厅id列表,长度不能超过20
     * @param hostedType 红包服务业务类型,暂只支持超级会员,"SUPER_VIP"
     * @return 红包服务执行结果列表 example:[{"shopId":964715,"result":true},{"shopId":324966853,"result":false,"reason":"通用红包活动单店暂无权限操作"}]
     * @throws ServiceException 服务异常
     */
    public List<ServiceResult> unhostShops(List<Long> shopIds, HostedType hostedType) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("shopIds", shopIds);
        params.put("hostedType", hostedType);
        return call("eleme.activity.coupon.unhostShops", params);
    }

    /**
     * 更改单店红包服务托管方式
     *
     * @param shopId 店铺Id
     * @param hostedType 红包服务业务类型,暂只支持超级会员,"SUPER_VIP"
     * @param oActivityServiceDetails 服务内容
     * @return 红包服务执行结果, example:{"shopId":964715",result":true,"reason":null}
     * @throws ServiceException 服务异常
     */
    public ServiceResult rehostShop(Long shopId, HostedType hostedType, OActivityServiceDetails oActivityServiceDetails)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("shopId", shopId);
        params.put("hostedType", hostedType);
        params.put("oActivityServiceDetails", oActivityServiceDetails);
        return call("eleme.activity.coupon.rehostShop", params);
    }

    /**
     * 定向赠红包(单店红包)
     *
     * @param shopId 店铺id
     * @param targetList 目标列表
     * @param targetListType 目标类型
     * @param targetCouponDetail 定向赠红包模板细节
     * @return 定向赠红包创建结果列表 example:[{"userId":null,"telephoneNumber":"18800009993","result":true,"couponId":"10065539304","reason":null}]
     * @throws ServiceException 服务异常
     */
    public List<TargetCouponResult> presentTargetCoupons(Long shopId, List<String> targetList, TargetListType targetListType, TargetCouponDetail targetCouponDetail)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("shopId", shopId);
        params.put("targetList", targetList);
        params.put("targetListType", targetListType);
        params.put("targetCouponDetail", targetCouponDetail);
        return call("eleme.activity.coupon.presentTargetCoupons", params);
    }

    /**
     * 定向赠通用红包
     *
     * @param chainId 连锁店id
     * @param targetList 目标列表
     * @param targetListType 目标类型
     * @param commonTargetCouponDetail 通用定向赠红包模板细节
     * @return 定向赠红包创建结果列表 example:[{"userId":null,"telephoneNumber":"18800009993","result":true,"couponId":"10065539304","reason":null}]
     * @throws ServiceException 服务异常
     */
    public List<TargetCouponResult> presentCommonTargetCoupons(Long chainId, List<String> targetList, TargetListType targetListType, CommonTargetCouponDetail commonTargetCouponDetail)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("chainId", chainId);
        params.put("targetList", targetList);
        params.put("targetListType", targetListType);
        params.put("commonTargetCouponDetail", commonTargetCouponDetail);
        return call("eleme.activity.coupon.presentCommonTargetCoupons", params);
    }

    /**
     * 分页查询店铺的定向赠红包信息
     *
     * @param targetCouponQueryRequest 定向赠红包查询入参对象
     * @return 定向赠红包信息列表 example:[{"couponId":"10072706280","status":"UNUSED","userId":"13524618","chainId":94202131,"useTime":null,"orderId":null,"shopId":null},{"couponId":"10072705256","status":"UNUSED","userId":"13524618","chainId":94202131,"useTime":null,"orderId":null,"shopId":null},{"couponId":"10065538990","status":"EXPIRED","userId":"25020977","chainId":94202131,"useTime":null,"orderId":null,"shopId":null}]
     * @throws ServiceException 服务异常
     */
    public List<TargetCouponInfo> queryTargetCouponInfo(TargetCouponQueryRequest targetCouponQueryRequest)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("targetCouponQueryRequest", targetCouponQueryRequest);
        return call("eleme.activity.coupon.queryTargetCouponInfo", params);
    }

    /**
     * 定向赠通用商品券
     *
     * @param chainId 连锁店id
     * @param targetList 目标列表
     * @param targetListType 目标类型
     * @param commonTargetSkuCouponDetail 通用定向赠连锁商品券模板细节
     * @return 创建结果列表 example:[{"userId":1233445,"telephoneNumber":null,"result":true,"couponId":"10065539304","reason":null}]
     * @throws ServiceException 服务异常
     */
    public List<TargetCouponResult> presentCommonTargetSkuCoupons(Long chainId, List<String> targetList, TargetListType targetListType, CommonTargetSkuCouponDetail commonTargetSkuCouponDetail)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("chainId", chainId);
        params.put("targetList", targetList);
        params.put("targetListType", targetListType);
        params.put("commonTargetSkuCouponDetail", commonTargetSkuCouponDetail);
        return call("eleme.activity.coupon.presentCommonTargetSkuCoupons", params);
    }

    /**
     * 定向赠连锁通用商品券
     *
     * @param chainId 连锁店id
     * @param targetList 目标列表
     * @param targetListType 目标类型
     * @param chainSkuCouponDetail 通用定向赠连锁商品券模板细节
     * @return 创建结果列表 example:[{"userId":1233445,"telephoneNumber":null,"result":true,"couponId":"10065539304","reason":null}]
     * @throws ServiceException 服务异常
     */
    public List<TargetCouponResult> presentChainSkuCoupons(Long chainId, List<String> targetList, TargetListType targetListType, ChainSkuCouponDetail chainSkuCouponDetail)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("chainId", chainId);
        params.put("targetList", targetList);
        params.put("targetListType", targetListType);
        params.put("chainSkuCouponDetail", chainSkuCouponDetail);
        return call("eleme.activity.coupon.presentChainSkuCoupons", params);
    }

    /**
     * 定向赠指定商品券
     *
     * @param targetList 目标列表
     * @param targetListType 目标类型
     * @param skuCouponDetail 商品券模板细节
     * @return 创建结果列表 example:[{"userId":1233445,"telephoneNumber":null,"result":true,"couponId":"10065539304","reason":null}]
     * @throws ServiceException 服务异常
     */
    public List<TargetCouponResult> presentSkuCoupons(List<String> targetList, TargetListType targetListType, SkuCouponDetail skuCouponDetail)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("targetList", targetList);
        params.put("targetListType", targetListType);
        params.put("skuCouponDetail", skuCouponDetail);
        return call("eleme.activity.coupon.presentSkuCoupons", params);
    }

    /**
     * 券状态变更
     *
     * @param criteria 券状态修改对象
     * @param type 操作类型
     * @return 券状态
     * @throws ServiceException 服务异常
     */
    public CouponStatus updateCouponStatus(CouponTransactionCriteria criteria, Integer type) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("criteria", criteria);
        params.put("type", type);
        return call("eleme.activity.coupon.updateCouponStatus", params);
    }

    /**
     * 创建并绑定连锁店特价活动
     *
     * @param activity 活动创建信息
     * @param chainId 连锁店Id
     * @param shopApplyInfo 绑定的商品信息
     * @return 活动参与详情|{"activityId": 47240183, "relations": [{"shopId": 150005159, "specId": 1014651, "participateId": 10168284}, {"shopId": 150005160, "specId": 1014652, "participateId": 10168285}]}
     * @throws ServiceException 服务异常
     */
    public SkuActivityFoodDetail createAndParticipateChainPriceActivity(SkuPriceActivityDTO activity, Long chainId, List<SkuActivityShopApplyInfoDTO> shopApplyInfo)
            throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("activity", activity);
        params.put("chainId", chainId);
        params.put("shopApplyInfo", shopApplyInfo);
        return call("eleme.activity.skuchain.createAndParticipateChainPriceActivity", params);
    }

    /**
     * 根据活动Id和店铺Id和商品规格Id，作废参与关系
     *
     * @param activityId 活动Id
     * @param shopId 店铺Id
     * @param specId 商品规格Id
     * @param comment 作废原因
     * @throws ServiceException 服务异常
     */
    public void inValidSkuActivityById(Long activityId, Long shopId, Long specId, String comment) throws ServiceException {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("activityId", activityId);
        params.put("shopId", shopId);
        params.put("specId", specId);
        params.put("comment", comment);
        call("eleme.activity.skuchain.inValidSkuActivityById", params);
    }

}
